<template>
	<view class="home">
		<!-- <view class="jiudian" v-if="user_type==0?true:false">
					<u--image 
					style="margin: 20rpx auto;display: block;"
					:showLoading="true" src="../../../static/jiudian.png" width="120px" height="120px" @click="click"></u--image>
				</view> -->
		
		<view class="swiper"><u-swiper :list="list2" keyName="image" showTitle :autoplay="false"></u-swiper></view>

  

<view v-if="user_type==0?true:false" class="notice" style="margin: 25rpx 0;">
   <u-notice-bar :text="text1"></u-notice-bar>	
</view>

		<view class="tabbox_">
			<u-grid :border="false" col="3">
				<u-grid-item v-if="user_type==0?true:false" @click=" topage('/pages/kefang/yuyuefangjian')">
					<u--image src="../../../static/yuyuefangjian.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >预约房间</text>
				</u-grid-item>
					
				<u-grid-item v-if="user_type==0?true:false" @click="topage('/pages/kefang/MYyuyuefangjian')">
					<u--image src="../../../static/myroom.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >我的房间</text>
				</u-grid-item>
				<u-grid-item v-if="user_type==0?true:false" @click="topage('/pages/kefangfuwu/fuwu')">
					<u--image src="../../../static/kefang.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >客房服务</text>
				</u-grid-item>
	
				<u-grid-item v-if="user_type==1 || user_type==2 ?true:false" @click=" topage('/pages/kefang/kefangguanli')">
					<u--image src="../../../static/kefang.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >客房管理</text>
				</u-grid-item>
				<u-grid-item v-if="user_type==1 || user_type==2 ?true:false" @click="topage('/pages/user/userList')">
					<u--image src="../../../static/kefuxinxi.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >客户信息管理</text>
				</u-grid-item>
				<u-grid-item v-if="user_type==1 || user_type==2 ?true:false" @click="topage('/pages/kefangfuwu/guanli')">
					<u--image src="../../../static/kefang.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >客房服务管理</text>
				</u-grid-item>
				<u-grid-item v-if="user_type==1 || user_type==2 ?true:false" @click="topage('/pages/kefang/baoxiu')">
					<u--image src="../../../static/qiangxiu.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >故障修理</text>
				</u-grid-item>
				<u-grid-item v-if="user_type==1 || user_type==2 ?true:false" @click=" topage('/pages/logs/logs')">
					<u--image src="../../../static/rizhi.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >工作日志</text>
				</u-grid-item>
				<u-grid-item v-if="user_type==2 ?true:false" @click="topage('/pages/user/dianyuan')">
					<u--image src="../../../static/kefuxinxi.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >店员信息管理</text>
				</u-grid-item>
				<u-grid-item v-if="user_type==2 ?true:false" @click="topage('/pages/kefang/tongji')">
					<u--image src="../../../static/tongji.png" width="120rpx" height="120rpx"></u--image>
					<text class="grid-text" >统计收益</text>
				</u-grid-item>
				
			</u-grid>
		</view>
		
	<view class="page-body" v-if="user_type==0?true:false">
		<view class="page-section page-section-gap">
			<map style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="covers">
			</map>
		</view>
	</view>	
		
		
	</view>
</template>

<script>
export default {
	data() {
		return {
			text1:"",
			user_type:"",
			list2: [
				{
					image: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					title: 'xx酒店欢迎您入住'
				},
				{
					image: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					title: 'xx酒店欢迎您入住'
				},
				{
					image: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
					title: 'xx酒店欢迎您入住'
				}
			],
			id:0, // 使用 marker点击事件 需要填写id
						title: 'map',
						latitude: 31.678134,
						longitude: 119.95446,
						covers: [{
							latitude: 31.678134,
							longitude: 119.95446,
							iconPath: '../../../static/'
						}, {
							latitude: 31.67,
							longitude: 119.95,
							iconPath: '../../../static/'
						}]
		};
	},
	onShow(){
		this.user_type=uni.getStorageSync('user_type')
		this.text1="欢迎您来到我们的酒店 "+uni.getStorageSync('supername')
	},
	 methods:{
		 topage(url){
			 uni.navigateTo({
			 	url: `${url}`
			 });
		 }
	 }


};
</script>

<style lang="scss">
	.home{
		background-color: #eee;
		min-height: 90vh;
		overflow: hidden;
		
		// .jiudian{
		// 	margin: 40rpx auto;
		// 	text-align: center;
		// 	width:120px;
		// 	height: 120px;
		// }
	}
.swiper {
	margin: 10upx 0;
}
/deep/.u-grid-item{
		background-color: red;
		margin: 0rpx;
		box-shadow:4px 4px 4px #c1c1c1 !important;
		padding: 20rpx;
		box-sizing: border-box;
	}
.grid-text{
	font-size: 34rpx;
	font-weight: 550;
	background-color: #fff;
	color: #6fbfe9;
	
}
.tabbox_{
	background-color: #fff;
	margin: 20rpx 0rpx;
	
}
</style>
